package com.lwz.multi.controller;


import com.lwz.multi.UserService;
import com.lwz.multi.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Lw中
 * @date 2020/9/18 21:18
 */
@RestController
public class HelloController {

    @Autowired
    UserService userService;

    @GetMapping("/hello")
    public String hello(){
        return "hello,world!";
    }

    @GetMapping("/user/{userId}")
    public User getUser(@PathVariable("userId")String userId){
        return userService.getUser(userId);
    }

}
